package com.vhall.component.service.export.handler;

import com.vhall.component.entity.export.ExportEntity;
import com.vhall.component.entity.export.dto.AdminExportCommonQueryCondition;
import com.vhall.component.service.account.AdminInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * admin-管理员导出
 *
 * @author yuanzh
 */
@Slf4j
@Component("adminExportHandler_6")
public class AdminExportAdminHandler implements BaseAdminExportHandler {

    private static final String FILE_NAME = "管理员列表";

    @Autowired
    private AdminInfoService adminInfoService;

    @Override
    public String getFileName() {
        return FILE_NAME;
    }

    @Override
    public int count(ExportEntity entity) {
        AdminExportCommonQueryCondition condition = AdminExportCommonQueryCondition.convertTo(entity.getParams());
        return adminInfoService.countAdminForAdminExport(condition);
    }
}
